#include "Thread.h"

class FileThread : public utils::Thread
{
	//Message<MessageType> &message



	utils::Mutex &m_mutex;

  public:
	//FileThread(Message<MessageType> &message, utils::Mutex &mutex) : m_queue(queue), m_mutex(mutex) {}

    void* run() {
        // Remove 1 item at a time and process it. Blocks if no items are
        // available to process.
        for (int i = 0;; i++) {

        	//	//filebuf
        	//	ifstream source("c:\\TempData\\test_in.mp4", ios::binary);
        	//	ofstream dest("c:\\TempData\\test_out.mp4", ios::binary);
        	//
        	//	istreambuf_iterator<char> begin_source(source);
        	//	istreambuf_iterator<char> end_source;
        	//	ostreambuf_iterator<char> begin_dest(dest);
        	//	copy(begin_source, end_source, begin_dest);
        	//
        	//	source.close();
        	//	dest.close();

//        	m_mutex.lock();
//        	std::cout << "thread " << (long unsigned int)self() << ", loop " << i << " - waiting for item..." << std::endl;
//        	m_mutex.unlock();
//
//            WorkItem* item = (WorkItem*)m_queue.removeFirst();
//
//            m_mutex.lock();
//            std::cout << "thread " << (long unsigned int)self() << ", loop " << i << " remove, size: " << m_queue.size() << std::endl;
//            m_mutex.unlock();
//
//            m_mutex.lock();
//            std::cout << "thread " << (long unsigned int)self() << ", loop " << i << " - got one item" << std::endl;
//            m_mutex.unlock();
//
//            m_mutex.lock();
//            std::cout << "thread " << (long unsigned int)self() << ", loop " << i << " - item: message - " << item->getMessage() << " number - " << item->getNumber() << std::endl;
//            m_mutex.unlock();
//            delete item;
        }
        return NULL;
    }
};
